﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;

public partial class Manage_GoodsNoPass : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumAdmin);
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumAttorney);
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumCheckGoods);
        if (HZ.MBSM.BLL.Login.CheckAssert(_AccountType))
        {
            if (!IsPostBack)
            {
                System.Data.IDataReader drn;
                Db dbn = new Db();
                string strNp = "select nopass from goods where goodsid=" + SysFun.IsSQL(SysFun.ToTrim(Request.QueryString["GoodsId"]));
                drn = dbn.DataReader(strNp);
                if (drn.Read())
                {
                    TextBox1.Text = SysFun.ToTrim(drn["nopass"].ToString());
                }
                drn.Dispose();
                drn.Close();
                dbn.Close();
            }
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
         
        HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
        if (_Account != null)
        {
            Db db = new Db();
            string strSql = "update goods set NoPass='" + SysFun.ToTrim(TextBox1.Text) + "', CheckStatus=2,AccountId_SH='" + SysFun.ToLong(_Account.AccountId) + "',shenhetime=getdate() where goodsid=" + SysFun.IsSQL(SysFun.ToTrim(Request.QueryString["GoodsId"]));
            db.Command(strSql);
            db.Close();
            Response.Write("<script>window.opener.location.reload();window.close();</script>");
        }
        else
        {
            Response.Write("<script language=JavaScript>alert('您无权审核商品信息！！！');</script>");
        }

    }
}
